make_page_readonly() must flush unused kmaps when handling
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 18 Nov 2005 16:50:25 +0000 (17:50 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 18 Nov 2005 16:50:25 +0000 (17:50 +0100)
a high-memory page. Otherwise stale writable mappings may
persist. This fixes a corner case for alloc_ldt (which can
vmalloc an LDT and hence use highmem pages).

Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c

index 9182e0708e8d29f22a32576899b5ba189460001f..d5782f963124cb21455c06806324806d380add54 100644 (file)
@@ -409,7 +409,9 @@ void make_page_readonly(void *va)
        if ((unsigned long)va >= (unsigned long)high_memory) {
                unsigned long pfn = pte_pfn(*pte);
 #ifdef CONFIG_HIGHMEM
-               if (pfn < highstart_pfn)
+               if (pfn >= highstart_pfn)
+                       kmap_flush_unused(); /* flush stale writable kmaps */
+               else
 #endif
                        make_lowmem_page_readonly(
                                phys_to_virt(pfn << PAGE_SHIFT));